In approaches for low-level program optimization, a compiler compiles and optimizes each module independently, and a linker links the compiled modules to form a program executable. Consequently, program optimization in these approaches is limited to individual modules because the compiler while compiling a particular module does not have access to information of other modules. In high-level or inter-procedural optimization approaches, the compiler compiles various modules at the same time, and, while compiling, has access to information of those various modules. As a result, the compiler, using such information, can better optimize the modules and thus the program. However, concurrently compiling/optimizing many modules encounters various problems such as exceeding memory limitations, requiring large amount of resources to maintain the large amount of information, data structure, etc.
In-lining refers to the process of copying programming code or body of a function to be called (the callee) into the function body of the calling function (the caller). In-lining provides good opportunities for optimization. Cross module in-lining refers to in-lining when the caller and the callee are in different modules. A compiler for cross-module optimization generally includes three phases, e.g., the front-end phase, the IPO (Inter-Procedural Optimization) phase, and the back-end phase. In an approach for cross-module optimization based on in-lining, the 3-phase compiler in-lines the code during the IPO phase, causing a bottle neck and longer time at this phase because while the front-end phase and the back-end phase can perform their tasks in parallel the IPO phase performs its tasks in series. Further, this approach may require multiple reading and writing the IR (Intermediate Representation) during the IPO phase, which results in a significant overhead for this phase.